This disclosure relates generally to adjusting the orientation of an image and straightening the scene displayed in the image. More particularly, but not by way of limitation, this disclosure relates to the use of information obtained from the analysis of an image to perform the orientation and straightening operations.
Digital images obtained with an image capture device are often stored with an improper orientation. For example, a user may intentionally rotate an image capture device to obtain an image having a portrait orientation but the device may store all images with a landscape orientation. A subsequent attempt to view or edit the image (on the image capture or another device) may therefore require a manual operation to orient the image properly. As used herein, the proper orientation of an image refers to the orientation of the image frame in which the image scene is depicted in the manner closest to the scene's actual orientation. Typically, an image frame may be oriented according to one of four cardinal orientations (i.e., 0°, 90°, 180°, 270°). While the process of manually adjusting the orientation of a single image is a relatively simple operation, it may be common for a typical user to capture hundreds or thousands of images within a short amount of time. The process of inspecting and adjusting the orientation of each image may be a time-consuming and tedious operation.
Moreover, even after the image is adjusted to its proper orientation, the image scene may not be properly aligned. For example, objects having a vertical alignment (e.g., buildings, people, etc.) may have a non-vertical alignment in the captured image. Therefore, in addition to adjusting the orientation of an image, a user may need to manually straighten the image scene. This process is more complicated than the adjustment of an image's orientation and it may be difficult for the user to achieve a precise adjustment. It would be desirable to automate these time-consuming and difficult image orientation and straightening operations.